#!/bin/bash

# composer vendor
composer update -o --no-plugins --no-scripts

# modify directory access
arr=(
    "backend" "frontend" "console"
)

for data in ${arr[@]}
do
    if [ -d "./${data}/runtime" ];then
        sudo chmod 777 ./${data}/runtime
        #sudo rm -rf ./${data}/runtime/*
    fi

     if [ -d "./${data}/web/assets" ];then
         sudo chmod 777 ./${data}/web/assets
         #sudo rm -rf ./${data}/web/assets/*
     fi
done